Dart.Mail Namespace > MailMessage Class > MailMessage Constructor : MailMessage Constructor(String,String,FileInfo[],List<Attachment>) |
Public Function New( _ ByVal text As String, _ ByVal html As String, _ ByVal htmlResources() As FileInfo, _ ByVal attachments As List(Of Attachment) _ )
Dim text As String Dim html As String Dim htmlResources() As FileInfo Dim attachments As List(Of Attachment) Dim instance As New MailMessage(text, html, htmlResources, attachments)
public MailMessage( string text, string html, FileInfo[] htmlResources, List<Attachment> attachments )
public: MailMessage( string* text, string* html, FileInfo*[]* htmlResources, List<Attachment*>* attachments )
public: MailMessage( String^ text, String^ html, array<FileInfo^>^ htmlResources, List<Attachment^>^ attachments )
Exception | Description |
---|---|
System.ArgumentException | htmlResources missing reference to an HTML link. |
System.ArgumentNullException | html cannot be null or empty. |
This constructor is used to create an HTML email with attachments. multipart/alternative and/or multipart/related parts are created to represent the parameters provided.
This method will create an email where Part.ContentType is set to "multipart/mixed". If text is null or empty, then html and htmlResources are used to create either a text/html part or a mulipart/related part that contains a text/html part taht will be added to the multipart/mixed part. Otherwise, that part's Part.ContentType is set to "multipart/alternative" and 2 parts (text/plain, and a text/html or multipart/related) are created and saved in Parts.
If htmlResources is null, then html is represented as a single Htmlpart. Otherwise, a new "multipart/related" Multipart is created and initialized with html and linked htmlResources.